package com.hyfrogx.modules.information.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyfrogx.common.exception.ServiceException;
import com.hyfrogx.common.qcloud.UploadUtils;
import com.hyfrogx.common.utils.QueryExt;
import com.hyfrogx.common.utils.R;
import com.hyfrogx.common.utils.SensiteWord;
import com.hyfrogx.common.utils.SpringContextUtils;
import com.hyfrogx.config.ImInfoConfig;
import com.hyfrogx.modules.app.entity.User;
import com.hyfrogx.modules.app.service.UserService;
import com.hyfrogx.modules.app.utils.FrogConstant;
import com.hyfrogx.modules.app.utils.StringUtils;
import com.hyfrogx.modules.information.entity.HyInformationEntity;
import com.hyfrogx.modules.information.entity.HyInformationOrderEntity;
import com.hyfrogx.modules.information.entity.HyInformationVerifyEntity;
import com.hyfrogx.modules.information.entity.InfoImgEntity;
import com.hyfrogx.modules.information.form.AddInformationModel;
import com.hyfrogx.modules.information.form.BatcEditInformationForm;
import com.hyfrogx.modules.information.service.*;
import com.hyfrogx.modules.manage.form.InfoForm;
import com.hyfrogx.modules.sys.controller.AbstractController;
import com.hyfrogx.modules.sys.entity.SysUserRoleEntity;
import com.hyfrogx.modules.sys.service.SysUserRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.util.*;

/**
 * @项目 hyplatform2
 * @日期: 2017年9月13日
 * @负责人: sw
 */
@RequestMapping("information")
@RestController
@Api(value = "HyInformationController", tags = {"后台--资讯管理"})
public class HyInformationController extends AbstractController {

  @Autowired
  private InformationService informationService;
  @Autowired
  private InfoImgService infoImgService;
  @Autowired
  private InfoSourceServie infoSourceService;
  @Autowired
  private HyInformationVerifyService hyInformationVerifyService;
  @Autowired
  private UserService userService;
  @Autowired
  private HyInformationOrderService orderService;
  @Autowired
  private SysUserRoleService roleService;
  @Autowired
  ImInfoConfig imInfoConfig;

  /**
   * 校验账号
   */
  //@RequiresPermissions(value = { "user:get", "role:manage", "account:manage" }, logical = Logical.OR)
  @RequestMapping(value = "get", method = RequestMethod.GET)
  @ApiOperation("校验账号")
  public R getUserList(String phone) {
    try {
      User user = userService.getBaseMapper().selectOne(new QueryWrapper<User>().eq("phone", phone));
      if (ObjectUtil.isNotNull(user)) {
        return R.ok();
      }
      return R.error();
    } catch (ServiceException e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 编辑图片上传
   *
   * @return
   */
  @RequestMapping(value = "uploadimg", method = RequestMethod.POST)
  @ApiOperation("资讯图片上传")
  public R uploadImg(@RequestParam("file") MultipartFile file) {
    String result = null;
    if (file != null) {
      String fileName = UUID.randomUUID().toString() + file.getOriginalFilename()
        .substring(file.getOriginalFilename()
          .lastIndexOf("."), file.getOriginalFilename().length());
      result = UploadUtils.upload(UploadUtils.convertFile(file), fileName, FrogConstant.Path.INFORMATION_FU);
    }
    return R.ok(result);
  }

  /**
   * 编辑图片上传
   *
   * @return
   */
  @RequestMapping(value = "delete/img", method = RequestMethod.POST)
  @ApiOperation("删除图片")
  public R uploadImg(String file) {
    if (StringUtils.isNotBlank(file)) {
      UploadUtils.deleteFile(file);
    }
    return R.ok();
  }

  @RequestMapping(value = "verified", method = RequestMethod.POST)
  @ApiOperation("校验资讯号")
  public R addVerifiedInformation() {
    if (getUserId() == 1) {
      return R.ok().put("reesult", 1);
    } else {
      Long role = roleService.getBaseMapper()
        .selectOne(new QueryWrapper<SysUserRoleEntity>()
          .eq("user_id", getUserId()).select("role_id")).getRoleId();
      if (role == FrogConstant.Role.MEDIA) {
        try {
          int result = orderService.getBaseMapper()
            .selectCount(new QueryWrapper<HyInformationOrderEntity>().eq("uid", getUser().getAppUid()));
          if (result > 0) {
            HyInformationOrderEntity order = orderService.getBaseMapper()
              .selectOne(new QueryWrapper<HyInformationOrderEntity>().eq("uid", getUser().getAppUid()));
            if (order.getExpireDate() == null) {
              return R.error("账号审核未通过,请先通过该资讯号的审核。补全到期时间");
            }
            if (System.currentTimeMillis() > order.getExpireDate().getTime()) {
              return R.ok().put("result", 0);
            } else {
              return R.ok().put("result", 1);
            }
          } else {
            return R.ok().put("result", 1);
          }
        } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }

      }
    }
    return R.error("查询异常");
  }

  @ApiOperation("富文本编辑器整段内容上传")
  @PostMapping("/content/uploadInfo")
  public @ResponseBody R uploadInfo(@RequestBody InfoForm form) {
    try {
      StringBuffer sb = new StringBuffer(form.getText());
      String fileName = UUID.randomUUID().toString() + System.currentTimeMillis() + ".txt";
      FileOutputStream fos = new FileOutputStream(FrogConstant.UEDITOR_INFORMATION_PUT_LOCAL + fileName);
      fos.write(sb.toString().getBytes());
      fos.close();
      String url = "";
      // 腾讯云
      File file = new File(FrogConstant.UEDITOR_INFORMATION_PUT_LOCAL + fileName);
      url = UploadUtils.uploadServerFile(file, FrogConstant.UEDITOR_INFORMATION_PUT);
      return R.ok(url);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }


  @RequestMapping(value = "addInformation", method = RequestMethod.POST)
  @ApiOperation("新增资讯")
  public R addInformation(@RequestBody AddInformationModel form) {
    HyInformationEntity information = new HyInformationEntity();
    BeanUtils.copyProperties(form, information);
    if (StrUtil.equals(SpringContextUtils.getActiveProfile(), SpringContextUtils.DEV_PROFILE)) {
      information.setApprovalStatus(FrogConstant.InformationStatus.APPROVALPASS.getValue());
      information.setApprovalTime(new Date());
    } else if (getUserId() == 1) {
      information.setApprovalStatus(FrogConstant.InformationStatus.APPROVALPASS.getValue());
      information.setApprovalTime(new Date());
    } else {
      information.setApprovalStatus(FrogConstant.InformationStatus.APPROVALOFFLINE.getValue());
    }

    try {
      information.setIsPull(FrogConstant.InformationStatus.NOTPULL.getValue());
      if (StrUtil.equals(SpringContextUtils.getActiveProfile(), SpringContextUtils.DEV_PROFILE)) {
        information.setUid(null);
      } else {
        information.setUid(getUser().getAppUid());
      }
      if (information.getSort() == null) {
        information.setSort(0.0);
      }
      information.setDayAttention(0);
      information.setDayCountComment(0);

      int juge = SensiteWord.jugeIsNormal(information.getText());
      if (juge > 0) {
        return R.error("存在脏字,校验不通过");
      }
      Integer id = informationService.put(information);

      if (form.getChannelIds() != null) {
        infoSourceService.put(id, form.getChannelIds());
      }

      //解析多图
      List<InfoImgEntity> infoImgList = new ArrayList<>();
      JSONArray jsonArray = JSONArray.parseArray(form.getJsonStr());
      if (jsonArray.size() > 0) {
        Iterator<Object> it = jsonArray.iterator();
        int i = 0;
        while (it.hasNext()) {
          InfoImgEntity infoImgEntity = jsonArray.getObject(i++, InfoImgEntity.class);
          infoImgList.add(infoImgEntity);
          if (form.getInfoImg().size() > 0) {
            infoImgService.put(form.getInfoImg(), id);
            return R.ok("操作成功");
          }
        }
      }

      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 根据发布者账号判断用户是否存在 返回1存在或者0不存在
   *
   * @return
   */
  @RequestMapping(value = "getuserByPublisher", method = RequestMethod.GET)
  @ApiOperation("根据发布者账号判断用户是否存在 返回1存在或者0不存在")
  public R getuserByAccount(String publisher) {
    try {
      User user = userService.getBaseMapper().selectOne(new QueryWrapper<User>().eq("account", publisher));
      if (ObjectUtil.isNull(user)) {
        return R.ok().put("result", 0);
      } else {
        return R.ok().put("result", 1);
      }
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 获取所有资讯
   *
   * @return
   */
  // @RequiresPermissions(value = { "infoContent:content" }, logical =
  // Logical.OR)
  @RequestMapping(value = "getallInformation", method = RequestMethod.GET)
  @ApiOperation("获取所有资讯")
  public R getallInformation(@RequestParam Map<String, Object> map) {
    try {
      if (!StrUtil.equals(SpringContextUtils.getActiveProfile(), SpringContextUtils.DEV_PROFILE)) {
        Long role = roleService.getBaseMapper()
          .selectOne(new QueryWrapper<SysUserRoleEntity>()
            .eq("user_id", getUserId()).select("role_id")).getRoleId();
        if (role == FrogConstant.Role.MEDIA) {
          map.put("publisher", getUser().getMobile());
        }
      }

      Page page = informationService.getallInformation(new QueryExt<>(map));
      return R.ok().put("result", page);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 获取所有推荐资讯
   *
   * @return
   */
  //@RequiresPermissions(value = { "infoRecommend:getallRecommendInfo" })
  @RequestMapping(value = "getallRecommendInformation", method = RequestMethod.GET)
  @ApiOperation("获取所有推荐资讯")
  public R getallRecommendInformation(@RequestParam Map<String, Object> map) {
    try {
      Page page = informationService.getallRecommendInformation(new QueryExt(map));
      return R.ok().put("result", page);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 资讯详情
   *
   * @return
   */
  @RequestMapping(value = "getInformationById", method = RequestMethod.GET)
  @ApiOperation("资讯详情")
  public R getInformationById(Integer id) {
    try {
      HyInformationEntity result = informationService.getInformationById(id, getUserId().intValue());


      return R.ok().put("result", result);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 编辑资讯
   *
   * @return
   */
  // @RequiresPermissions(value = { "infoContent:editInfo" })
  @RequestMapping(value = "editInformation", method = RequestMethod.POST)
  @ApiOperation("编辑资讯")
  public R editInformation(@RequestBody AddInformationModel form) {
    if (form.getId() == null) {
      return R.error("请选择资讯");
    }
    HyInformationEntity information = new HyInformationEntity();
    try {
      // 获取拼接好的jsonstr转换成数组
      JSONArray jsonArray = JSONArray.parseArray(form.getJsonStr());
      List<InfoImgEntity> infoImgs = new ArrayList<>();
      for (int i = 0; i < jsonArray.size(); i++) {
        InfoImgEntity infoImg = jsonArray.getObject(i, InfoImgEntity.class);
        // 如果没有图片说明是删除本关联图集对象
        if (infoImg.getId() != null && StringUtils.isBlank(infoImg.getImg())) {
          infoImgService.removeById(infoImg.getId());
          continue;
        }
        // 如果有id 说明是编辑
        if (infoImg.getId() != null) {
          infoImgService.updateById(infoImg);
        } else {
          // 没有id 是新增
          infoImg.setInfoId(form.getId());
          infoImgService.save(infoImg);
        }
      }
      if (ObjectUtil.isNotEmpty(form.getChannelIds())) {
        infoSourceService.put(form.getId(), form.getChannelIds());
      }

      if (form.getApprovalStatus() != null) {
        information.setApprovalTime(new Date());
      }
      if (form.getText() != null) {
        int juge = SensiteWord.jugeIsNormal(form.getText());
        if (juge > 0) {
          return R.error("存在脏字,校验不通过");
        }
      }

      BeanUtils.copyProperties(form, information);
      informationService.editInformation(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 资讯客户端提交审核
   *
   * @return
   */
  @RequestMapping(value = "editInformationStatus", method = RequestMethod.POST)
  @ApiOperation("资讯客户端提交审核")
  public R editInformationStatus(@RequestBody HyInformationEntity information) {
    if (information.getApprovalStatus() == null || information.getId() == null) {
      return R.error("资讯审核状态及资讯id必传");
    }
    if (StringUtils.isBlank(information.getFailReason())) {
      information.setFailReason(null);
    }
    // 如果是审核不通过,给与审核时间
    if (information.getApprovalStatus() == FrogConstant.InformationStatus.APPROVALREJECT.getValue()) {
      information.setApprovalTime(new Date());
    }

    // 如果是审核通过,同时给与发布时间及审核时间
    if (information.getApprovalStatus() == FrogConstant.InformationStatus.APPROVALPASS.getValue()) {
      information.setState(1);
      information.setApprovalTime(new Date());
      information.setPublishTime(new Date());
    }
    informationService.editInformation(information);
    return R.ok("操作成功");
  }

  /**
   * 取消推荐
   *
   * @return
   */
  //@RequiresPermissions(value = {"infoRecommend:delRecommendInfo"})
  @RequestMapping(value = "cancelInformationRecommend", method = RequestMethod.GET)
  @ApiOperation("取消推荐")
  public R cancelInformationRecommend(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      information.setIsRecommend(FrogConstant.InformationStatus.NOTRECOMMEND.getValue());
      informationService.updateById(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 推荐置顶
   *
   * @return
   */
  @RequestMapping(value = "StickInformationTjtop", method = RequestMethod.GET)
  @ApiOperation("推荐置顶")
  public R StickInformationTjtop(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      information.setTjTop(FrogConstant.InformationStatus.TOP.getValue());
      informationService.updateById(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 取消推荐置顶
   *
   * @return
   */
  @RequestMapping(value = "NotStickInformationTjtop", method = RequestMethod.GET)
  @ApiOperation("取消推荐置顶")
  public R NotStickInformationTjtop(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      information.setTjTop(FrogConstant.InformationStatus.NOTTOP.getValue());
      informationService.updateById(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 推荐
   *
   * @return
   */
  //@RequiresPermissions(value = {"infoContent:recommend"})
  @ApiOperation("推荐")
  @RequestMapping(value = "RecommendInformation", method = RequestMethod.GET)
  public R RecommendInformation(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      information.setIsRecommend(FrogConstant.InformationStatus.RECOMMEND.getValue());
      information.setTjTop(FrogConstant.InformationStatus.NOTTOP.getValue());
      informationService.updateById(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 置顶
   *
   * @return
   */
  @RequestMapping(value = "StickInformation", method = RequestMethod.GET)
  @ApiOperation("置顶，分类置顶")
  public R StickInformation(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      information.setIsTop(FrogConstant.InformationStatus.RECOMMEND.getValue());
      informationService.updateById(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 取消置顶
   *
   * @return
   */
  @RequestMapping(value = "NotStickInformation", method = RequestMethod.GET)
  @ApiOperation("取消置顶")
  public R NotStickInformation(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      information.setIsTop(FrogConstant.InformationStatus.NOTTOP.getValue());
      informationService.updateById(information);
      return R.ok("操作成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 发布资讯
   *
   * @return
   */
  //@RequiresPermissions(value = {"infoContent:publish"})
  @RequestMapping(value = "publishInformation", method = RequestMethod.GET)
  @ApiOperation("发布资讯")
  public R publishInformation(Integer id) {
    try {
      Integer state = informationService.publishInformation(id);
      return R.ok().put("result", state);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 下线资讯
   *
   * @return
   */
  // @RequiresPermissions(value = { "infoContent:downInfo" })
  @RequestMapping(value = "downInformation", method = RequestMethod.GET)
  @ApiOperation("下线资讯")
  public R downInformation(Integer id) {
    try {
      HyInformationEntity information = new HyInformationEntity();
      information.setId(id);
      Integer state = informationService.downInformation(information);
      // 如果不是内部运营者账号提交的资讯,要回到待审核状态
      information.setApprovalStatus(FrogConstant.InformationStatus.APPROVALOFFLINE.getValue());
      informationService.editInformation(information);
      return R.ok().put("result", state);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }


  /**
   * 获取指定资讯富文本编辑器内容
   *
   * @return
   */
  @RequestMapping(value = "getEditorById", method = RequestMethod.GET)
  @ApiOperation("获取指定资讯富文本编辑器内容")
  public R getEditorById(Integer id) {
    try {
      HyInformationEntity result = informationService.getBaseMapper()
        .selectOne(new QueryWrapper<HyInformationEntity>().select("text").eq("id", id));
      return R.ok().put("result", result);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }


  /**
   * 判断当前分类下是否有资源
   *
   * @return
   */
  @RequestMapping(value = "judgeInfoById", method = RequestMethod.POST)
  @ApiOperation("判断当前分类下是否有资源")
  public R judgeInfoById(Integer id) {
    List<HyInformationEntity> result = informationService.judgeInfoById(id);
    if (CollUtil.isNotEmpty(result)) {
      return R.ok().put("result", 1);
    } else {
      return R.ok().put("result", 0);
    }
  }

  /**
   * 富文本编辑器图片上传
   *
   * @return
   */
  @RequestMapping(value = "uploadImg", method = RequestMethod.POST)
  @ApiOperation("富文本编辑器图片上传")
  public R uploadImg(HttpServletRequest request) {
    try {
      CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
        request.getSession().getServletContext());
      String fileName = null;
      if (multipartResolver.isMultipart(request)) {
        MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
        Iterator<String> iter = multiRequest.getFileNames();
        while (iter.hasNext()) {
          MultipartFile file = multiRequest.getFile(iter.next().toString());
          if (file != null) {
            fileName = UUID.randomUUID().toString() + file.getOriginalFilename().substring(
              file.getOriginalFilename().lastIndexOf("."), file.getOriginalFilename().length());
            String path = System.getProperty(FrogConstant.Path.INFORMATION_FU) + fileName;
            // 文件开始上传
            file.transferTo(new File(path));

          }
        }
      }

      return R.ok(fileName);
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 批量上线下线
   *
   * @return
   */
  @RequestMapping(value = "batchEdit/state", method = RequestMethod.POST)
  @ApiOperation("批量上线下线")
  public R batchEditState(@RequestBody BatcEditInformationForm form) {
    try {
      if (CollUtil.isEmpty(form.getIdList())) {
        return R.error("请选择资讯");
      }

      if (form.getState() == FrogConstant.Information.INFORMATION_STATE_NOT_PUBLISH) {
        return R.error("不可更改为未发布");
      }

      HyInformationEntity channel = new HyInformationEntity();
      for (Integer id : form.getIdList()) {
        // 发布状态0未发布 1发布2下架
        channel.setId(id);
        if (form.getState() == FrogConstant.Information.INFORMATION_STATE_PUBLISH) {
          informationService.publishInformation(channel.getId());
        } else if (form.getState() == FrogConstant.Information.INFORMATION_STATE_UPPER) {
          informationService.downInformation(channel);
        }
      }
      return R.ok("更新成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /**
   * 编辑我的账户
   *
   * @param record
   * @param user
   * @return
   */
  @RequestMapping(value = "account/edit", method = RequestMethod.POST)
  @ApiOperation("编辑我的账户")
  public R editAccount(HyInformationVerifyEntity record, User user) {
    try {
      HyInformationVerifyEntity result = hyInformationVerifyService.getVerifyRecordByUid(record.getUid());
      record.setId(result.getId());
      if (!hyInformationVerifyService.updateById(record)) {
        return R.ok("更新账户信息失败");
      }
      userService.updateById(user);
      return R.ok("更新成功");
    } catch (Exception e) {
      return R.error(e.getMessage());
    }
  }

  /*	*//**
   * 更新后台用户头像
   *
   * @param request
   * @return
   *//*
	@RequestMapping("update/accountimg")
  @ApiOperation("更新后台用户头像")
	public R updateImg(@RequestParam("file") MultipartFile file, Integer uid) {
		try {
			if (file == null) {
				return R.error("请选择上传图片!");
			}
			userService.updateUserImg(uid, file);
			return R.ok(userService.getUsersById(uid).getHead());
		} catch (Exception e) {
			return R.error(e.getMessage());
		}
	}*/

  /*
   * 富文本编辑器图片上传
   *
   * @return
   */
	/*@RequestMapping(value = "uploadEditorImg", method = RequestMethod.POST)
  @ApiOperation("富文本编辑器图片上传")
	public
  LiResult uploadTest(HttpServletRequest request) {
		try {
			CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
					request.getSession().getServletContext());
			String fileName = null;
			if (multipartResolver.isMultipart(request)) {
				MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
				Iterator<String> iter = multiRequest.getFileNames();
				while (iter.hasNext()) {
					MultipartFile file = multiRequest.getFile(iter.next().toString());
					if (file != null) {
						fileName = UUID.randomUUID().toString() + file.getOriginalFilename().substring(
								file.getOriginalFilename().lastIndexOf("."), file.getOriginalFilename().length());
						String path = System.getProperty(FrogConstant.Path.INFORMATION_FU) + fileName;
						// 文件开始上传
						file.transferTo(new File(path));

					}
				}
			}
			return ajaxLiSuccess(QCloudUtils.editorImgUrl + fileName);
		} catch (Exception e) {
			return ajaxLiFail(e.getMessage());
		}
	}*/


}
